#!/bin/bash
while :
do
  size=$(du -sm /var/log/abc.log 2>/dev/null | awk '{print $1}')
  if (( size > 100 ))
  then
      mv -f /var/log/abc.log /var/log/abc.log.1
  fi 
  date >> /var/log/abc.log
  ps -eLo 'tid,stat,pid,comm,pcpu,psr,wchan' >> /var/log/abc.log
  grep -s '.*' /proc/*/task/*/stack >> /var/log/abc.log
  sleep 2
done
